package lj.courseinterect.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by Administrator on 2015/4/22.
 */
@javax.persistence.Entity
@Table(name = "course_info")
public class CourseInfo implements Entity {
    public enum CouState {
        NORMAL, // 正常
        CLOSED, // 关闭
        OTHERS // 其他
    }
    public enum LocState {
        CLOSED, // 关闭
        OPEN, // 开放
        OTHERS // 完成
    }

    /**
     * 主键id
     */
    @Id
    @GeneratedValue
    @Column(name = "cou_id")
    private Long couId;

    /**
     * 教师编号
     */
    @Column(name = "tea_id", nullable = false)
    private Long teaId;
    /**
     * 课程名称
     */
    @Column(name="cou_name",length = 100,nullable = false)
    private String couName;
    /**
     * 课程人数
     */
    @Column(name="cou_count")
    private int couCount = 0;
    /**
     * 课程年级
     */
    @Column(name="cou_grade", nullable = false, length = 20)
    private String couGrade;
    /**
     * 课程备注
     */
    @Lob
    @Column(name="cou_text")
    private String couText;
    /**
     * 课程添加时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="cou_time", updatable = false)
    private Date couTime;
    /**
     * 专业id
     */
    @Column(name = "major_id", nullable = false)
    private int majorId;

    /**
     * 课程状态
     */
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "cou_state", columnDefinition = "int(11) default 0")
    private CouState couState = CouState.NORMAL;
    /**
     * 点名状态
     */
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "loc_state", columnDefinition = "int(11) default 0")
    private LocState locState = LocState.CLOSED;
    /**
     * 签到总次数
     */
    @Column(name = "sign_count")
    private int signCount = 0;

    /**
     * 练习数量
     */
    @Column(name = "exam_num")
    private int examNum = 0;

    public Long getCouId() {
        return couId;
    }

    public void setCouId(Long couId) {
        this.couId = couId;
    }

    public Long getTeaId() {
        return teaId;
    }

    public void setTeaId(Long teaId) {
        this.teaId = teaId;
    }

    public String getCouName() {
        return couName;
    }

    public void setCouName(String couName) {
        this.couName = couName;
    }

    public int getCouCount() {
        return couCount;
    }

    public void setCouCount(int couCount) {
        this.couCount = couCount;
    }

    public String getCouGrade() {
        return couGrade;
    }

    public void setCouGrade(String couGrade) {
        this.couGrade = couGrade;
    }

    public String getCouText() {
        return couText;
    }

    public void setCouText(String couText) {
        this.couText = couText;
    }

    public Date getCouTime() {
        return couTime;
    }

    public void setCouTime(Date couTime) {
        this.couTime = couTime;
    }

    public int getMajorId() {
        return majorId;
    }

    public void setMajorId(int majorId) {
        this.majorId = majorId;
    }

    public CouState getCouState() {
        return couState;
    }

    public void setCouState(CouState couState) {
        this.couState = couState;
    }

    public LocState getLocState() {
        return locState;
    }

    public void setLocState(LocState locState) {
        this.locState = locState;
    }

    public int getSignCount() {
        return signCount;
    }

    public void setSignCount(int signCount) {
        this.signCount = signCount;
    }

    public int getExamNum() {
        return examNum;
    }

    public void setExamNum(int examNum) {
        this.examNum = examNum;
    }
}
